home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / MoofWars / MoofEncoder / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.5 KB  |  125 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        main.h
  3.  
  4.     Contains:    An extremely basic encoder utility to assist in building all of the various
  5.                  "compiled" resources used by MoofWars.  Many of the encoder utilities are actually
  6.                 handled by things in the standard TGraphic class, so the main reason for pre-encoding
  7.                 the graphics is to improve the time to load the graphics in the game.
  8.  
  9.     Written by: Timothy Carroll    
  10.  
  11.     Copyright:    Copyright © 1996-1999 by Apple Computer, Inc., All Rights Reserved.
  12.  
  13.                 You may incorporate this Apple sample source code into your program(s) without
  14.                 restriction. This Apple sample source code has been provided "AS IS" and the
  15.                 responsibility for its operation is yours. You are not permitted to redistribute
  16.                 this Apple sample source code as "Apple sample source code" after having made
  17.                 changes. If you're going to re-distribute the source, we require that you make
  18.                 it clear in the source that the code was descended from Apple sample source
  19.                 code, but that you've made changes.
  20.  
  21.     Change History (most recent first):
  22.                 7/1/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  23.                 2/27/97        Timothy Carroll    Conditionally include Metrowerks headers
  24.                                             to be more compiler-friendly
  25.                 2/27/97        Timothy Carroll    Now load app conditionals and error macros 
  26.                                             from separate files
  27.                 8/15/96        Timothy Carroll    Initial Release
  28. #
  29. #    
  30. #
  31. #                    
  32.  
  33. */
  34.  
  35. #ifndef _MOOFENCODE_
  36. #define _MOOFENCODE_
  37.  
  38. #pragma once
  39.  
  40. #include <Quickdraw.h>
  41. #include <QDOffscreen.h>
  42. #include <Palettes.h>
  43. #include <DrawSprocket.h>
  44.  
  45.  
  46. #include "AppConditionals.h"
  47.  
  48.  
  49.     
  50.  
  51. /*********************************************************************************
  52.     OTHER NECESSARY HEADERS    
  53. *********************************************************************************/
  54. #include "Scaling.h"
  55. #include "TGraphicCollection.h"
  56.  
  57.  
  58. /*********************************************************************************
  59.     CONSTANTS    
  60. *********************************************************************************/
  61.  
  62.  
  63. // A few standard colors -- probably should use palette calls instead!
  64. const RGBColor kWhite = {0xFFFF, 0xFFFF, 0xFFFF};
  65. const RGBColor kBlack = {0x0000, 0x0000, 0x0000};
  66. const RGBColor kDarkBlue = {0x0000,0x0000,0x7000};
  67. const RGBColor kLtGrey = {0xC000,0xC000,0xC000};
  68. const RGBColor kMediumGrey = {0x7FFF,0x7FFF,0x7FFF};
  69.  
  70. // The ResID of the application's color table.  All of my custom graphics routines use
  71. // an 8-bit color table and the sprite is encoded to use these colors.  The actual variable
  72. // to hold the color table is declared below.
  73.  
  74. enum {
  75.     kAppColorTableResID = 128
  76. };
  77.  
  78. // Various constants used to load the background tile and sprite graphics.
  79.  
  80. enum {
  81.     kGridResourceID = 500
  82. };
  83.  
  84. enum {
  85.     kPreferredDepth = 8
  86. };
  87.  
  88. // We'll use these contants to tailor the Application's behavior.
  89. enum {
  90.     kEventInterval = 3,
  91.     kNumberOfMasters = 10,
  92.     kSleepTime = 0
  93. };
  94.  
  95. // Constants for all the menu functions
  96. enum
  97. {
  98.     rMenuBar = 128,
  99.     mAppleMenu = 128,
  100.         iAboutApp = 1,
  101.     mFileMenu = 129,
  102.         iEncodeIcons = 1,
  103.         iEncodePICTs = 2,
  104.         iTriplePICTs = 4,
  105.         iEncodeTiles = 5,
  106.         iQuit = 7
  107. };
  108.  
  109. /*********************************************************************************
  110.     Globals    
  111. *********************************************************************************/
  112.  
  113. // The main color table described above
  114. extern CTabHandle            gAppColorTable;
  115.  
  116.  
  117. /*********************************************************************************
  118.     Functions    
  119. *********************************************************************************/
  120.  
  121. OSStatus CopyResource (SInt16 inRes, SInt16 outRes, OSType theType, SInt16 theID);
  122.  
  123. #endif /* _MOOFENCODE_ */
  124.  
  125.